<?php


namespace app\common\model;


use think\Cache;

class SysMessageCategory extends BaseModel{

    protected static $listCacheKey = 'SysMsgCategoryCache';
    protected static $cacheExpire = 3600;

    public static function getList(){
        if(!Cache::has(self::$listCacheKey) || config('app_debug') === "1"){
            $value = self::where('status',1)->field('id,icon_image,name')->order('weigh','desc')->select();
            Cache::set(self::$listCacheKey,$value,self::$cacheExpire);
        }
        return Cache::get(self::$listCacheKey);
    }
}